<!DOCTYPE HTML>
<html lang="zh-cn" class="light" dir="ltr">
    <head>
            <script type="text/x-mathjax-config">
                MathJax.Hub.Config({
                    showProcessingMessages: false,
                    messageStyle: "none",
                    extensions: ['tex2jax.js'],
                    jax: ['input/TeX', 'output/HTML-CSS'],
                    tex2jax: {
                        inlineMath: [ ['$','$'], ["\\(","\\)"] ],
                        displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
                        processEscapes: true
                    },
                    "HTML-CSS": { availableFonts: ["STIX", "TeX"] }
                });
            </script>
            
        <!-- Book generated using mdBook -->
        <meta charset="UTF-8">
        <title>结构体 - 仓颉编程语言扩展库 API</title>


        <!-- Custom HTML head -->
        
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="theme-color" content="#ffffff">

        <link rel="icon" href="../../../favicon.svg">
        <link rel="shortcut icon" href="../../../favicon.png">
        <link rel="stylesheet" href="../../../css/variables.css">
        <link rel="stylesheet" href="../../../css/general.css">
        <link rel="stylesheet" href="../../../css/chrome.css">
        <link rel="stylesheet" href="../../../css/print.css" media="print">

        <!-- Fonts -->
        <link rel="stylesheet" href="../../../FontAwesome/css/font-awesome.css">
        <link rel="stylesheet" href="../../../fonts/fonts.css">

        <!-- Highlight.js Stylesheets -->
        <link rel="stylesheet" href="../../../highlight.css">
        <link rel="stylesheet" href="../../../tomorrow-night.css">
        <link rel="stylesheet" href="../../../ayu-highlight.css">

        <!-- Custom theme stylesheets -->
        <link rel="stylesheet" href="../../../assets/style.css">
        <link rel="stylesheet" href="../../../assets/theme.css">

        <!-- MathJax -->
        <script async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
    </head>
    <body class="sidebar-visible no-js">
    <div id="body-container">
        <!-- Provide site root to javascript -->
        <script>
            var path_to_root = "../../../";
            var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "light" : "light";
        </script>

        <!-- Work around some values being stored in localStorage wrapped in quotes -->
        <script>
            try {
                var theme = localStorage.getItem('mdbook-theme');
                var sidebar = localStorage.getItem('mdbook-sidebar');

                if (theme.startsWith('"') && theme.endsWith('"')) {
                    localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
                }

                if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
                    localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
                }
            } catch (e) { }
        </script>

        <!-- Set the theme before any content is loaded, prevents flash -->
        <script>
            var theme;
            try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
            if (theme === null || theme === undefined) { theme = default_theme; }
            var html = document.querySelector('html');
            html.classList.remove('light')
            html.classList.add(theme);
            var body = document.querySelector('body');
            body.classList.remove('no-js')
            body.classList.add('js');
        </script>

        <input type="checkbox" id="sidebar-toggle-anchor" class="hidden">

        <!-- Hide / unhide sidebar before it is displayed -->
        <script>
            var body = document.querySelector('body');
            var sidebar = null;
            var sidebar_toggle = document.getElementById("sidebar-toggle-anchor");
            if (document.body.clientWidth >= 1080) {
                try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
                sidebar = sidebar || 'visible';
            } else {
                sidebar = 'hidden';
            }
            sidebar_toggle.checked = sidebar === 'visible';
            body.classList.remove('sidebar-visible');
            body.classList.add("sidebar-" + sidebar);
        </script>

        <nav id="sidebar" class="sidebar" aria-label="Table of contents">
            <div class="sidebar-scrollbox">
                <ol class="chapter"><li class="chapter-item expanded "><a href="../../../libs_overview.html"><strong aria-hidden="true">1.</strong> 仓颉编程语言扩展库 API</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../aspectCJ/aspectCJ_package_overview.html"><strong aria-hidden="true">1.1.</strong> stdx.aspectCJ</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../aspectCJ/aspectCJ_package_api/aspectCJ_package_classes.html"><strong aria-hidden="true">1.1.1.</strong> 类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.1.2.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../aspectCJ/aspectCJ_samples/aspectCJ_sample.html"><strong aria-hidden="true">1.1.2.1.</strong> aspecjCJ 使用</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../../compress/zlib/zlib_package_overview.html"><strong aria-hidden="true">1.2.</strong> stdx.compress.zlib</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../compress/zlib/zlib_package_api/zlib_package_classes.html"><strong aria-hidden="true">1.2.1.</strong> 类</a></li><li class="chapter-item "><a href="../../../compress/zlib/zlib_package_api/zlib_package_enums.html"><strong aria-hidden="true">1.2.2.</strong> 枚举</a></li><li class="chapter-item "><a href="../../../compress/zlib/zlib_package_api/zlib_package_exceptions.html"><strong aria-hidden="true">1.2.3.</strong> 异常类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.2.4.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../compress/zlib/zlib_samples/deflate_compress_decompress.html"><strong aria-hidden="true">1.2.4.1.</strong> Deflate 格式数据的压缩和解压</a></li><li class="chapter-item "><a href="../../../compress/zlib/zlib_samples/gzip_compress_decompress.html"><strong aria-hidden="true">1.2.4.2.</strong> Gzip 格式数据的压缩和解压</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../../crypto/crypto/crypto_package_overview.html"><strong aria-hidden="true">1.3.</strong> stdx.crypto.crypto</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../crypto/crypto/crypto_package_api/crypto_package_classes.html"><strong aria-hidden="true">1.3.1.</strong> 类</a></li><li class="chapter-item "><a href="../../../crypto/crypto/crypto_package_api/crypto_package_structs.html"><strong aria-hidden="true">1.3.2.</strong> 结构体</a></li><li class="chapter-item "><a href="../../../crypto/crypto/crypto_package_api/crypto_package_exceptions.html"><strong aria-hidden="true">1.3.3.</strong> 异常类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.3.4.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../crypto/crypto/crypto_samples/sample_secure_random.html"><strong aria-hidden="true">1.3.4.1.</strong> SecureRandom 使用</a></li><li class="chapter-item "><a href="../../../crypto/crypto/crypto_samples/sample_crypto.html"><strong aria-hidden="true">1.3.4.2.</strong> SM4 使用</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../../crypto/digest/crypto_digest_package_overview.html"><strong aria-hidden="true">1.4.</strong> stdx.crypto.digest</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../crypto/digest/digest_package_api/digest_package_classes.html"><strong aria-hidden="true">1.4.1.</strong> 类</a></li><li class="chapter-item "><a href="../../../crypto/digest/digest_package_api/digest_package_structs.html"><strong aria-hidden="true">1.4.2.</strong> 结构体</a></li><li class="chapter-item "><a href="../../../crypto/digest/digest_package_api/digest_package_exceptions.html"><strong aria-hidden="true">1.4.3.</strong> 异常类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.4.4.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../crypto/digest/digest_samples/sample_digest.html"><strong aria-hidden="true">1.4.4.1.</strong> digest 使用</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../../crypto/keys/keys_package_overview.html"><strong aria-hidden="true">1.5.</strong> stdx.crypto.keys</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../crypto/keys/keys_package_api/keys_package_classes.html"><strong aria-hidden="true">1.5.1.</strong> 类</a></li><li class="chapter-item "><a href="../../../crypto/keys/keys_package_api/keys_package_enums.html"><strong aria-hidden="true">1.5.2.</strong> 枚举</a></li><li class="chapter-item "><a href="../../../crypto/keys/keys_package_api/keys_package_structs.html"><strong aria-hidden="true">1.5.3.</strong> 结构体</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.5.4.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../crypto/keys/keys_samples/sample_keys.html"><strong aria-hidden="true">1.5.4.1.</strong> keys 使用</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../../crypto/x509/x509_package_overview.html"><strong aria-hidden="true">1.6.</strong> stdx.crypto.x509</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../crypto/x509/x509_package_api/x509_package_type.html"><strong aria-hidden="true">1.6.1.</strong> 类型别名</a></li><li class="chapter-item "><a href="../../../crypto/x509/x509_package_api/x509_package_interfaces.html"><strong aria-hidden="true">1.6.2.</strong> 接口</a></li><li class="chapter-item "><a href="../../../crypto/x509/x509_package_api/x509_package_classes.html"><strong aria-hidden="true">1.6.3.</strong> 类</a></li><li class="chapter-item "><a href="../../../crypto/x509/x509_package_api/x509_package_enums.html"><strong aria-hidden="true">1.6.4.</strong> 枚举</a></li><li class="chapter-item "><a href="../../../crypto/x509/x509_package_api/x509_package_structs.html"><strong aria-hidden="true">1.6.5.</strong> 结构体</a></li><li class="chapter-item "><a href="../../../crypto/x509/x509_package_api/x509_package_exceptions.html"><strong aria-hidden="true">1.6.6.</strong> 异常类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.6.7.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../crypto/x509/x509_samples/sample_x509.html"><strong aria-hidden="true">1.6.7.1.</strong> x509 使用</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../../encoding/base64/base64_package_overview.html"><strong aria-hidden="true">1.7.</strong> stdx.encoding.base64</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../encoding/base64/base64_package_api/base64_package_funcs.html"><strong aria-hidden="true">1.7.1.</strong> 函数</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.7.2.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../encoding/base64/base64_samples/base64.html"><strong aria-hidden="true">1.7.2.1.</strong> Byte 数组和 Base64 互转</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../../encoding/hex/hex_package_overview.html"><strong aria-hidden="true">1.8.</strong> stdx.encoding.hex</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../encoding/hex/hex_package_api/hex_package_funcs.html"><strong aria-hidden="true">1.8.1.</strong> 函数</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.8.2.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../encoding/hex/hex_samples/hex.html"><strong aria-hidden="true">1.8.2.1.</strong> Byte 数组和 Hex 互转</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../../encoding/json/json_package_overview.html"><strong aria-hidden="true">1.9.</strong> stdx.encoding.json</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../encoding/json/json_package_api/encoding_json_package_interfaces.html"><strong aria-hidden="true">1.9.1.</strong> 接口</a></li><li class="chapter-item "><a href="../../../encoding/json/json_package_api/encoding_json_package_classes.html"><strong aria-hidden="true">1.9.2.</strong> 类</a></li><li class="chapter-item "><a href="../../../encoding/json/json_package_api/encoding_json_package_enums.html"><strong aria-hidden="true">1.9.3.</strong> 枚举</a></li><li class="chapter-item "><a href="../../../encoding/json/json_package_api/encoding_json_package_exceptions.html"><strong aria-hidden="true">1.9.4.</strong> 异常类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.9.5.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../encoding/json/json_samples/json_array_sample.html"><strong aria-hidden="true">1.9.5.1.</strong> JsonArray 使用示例</a></li><li class="chapter-item "><a href="../../../encoding/json/json_samples/json_value_sample.html"><strong aria-hidden="true">1.9.5.2.</strong> JsonValue 和 String 互相转换</a></li><li class="chapter-item "><a href="../../../encoding/json/json_samples/to_json_sample.html"><strong aria-hidden="true">1.9.5.3.</strong> JsonValue 与 DataModel 的转换</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../../encoding/json_stream/json_stream_package_overview.html"><strong aria-hidden="true">1.10.</strong> stdx.encoding.json.stream</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../encoding/json_stream/json_stream_package_api/encoding_json_stream_package_interfaces.html"><strong aria-hidden="true">1.10.1.</strong> 接口</a></li><li class="chapter-item "><a href="../../../encoding/json_stream/json_stream_package_api/encoding_json_stream_package_classes.html"><strong aria-hidden="true">1.10.2.</strong> 类</a></li><li class="chapter-item "><a href="../../../encoding/json_stream/json_stream_package_api/encoding_json_stream_package_enums.html"><strong aria-hidden="true">1.10.3.</strong> 枚举</a></li><li class="chapter-item "><a href="../../../encoding/json_stream/json_stream_package_api/encoding_json_stream_package_structs.html"><strong aria-hidden="true">1.10.4.</strong> 结构体</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.10.5.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../encoding/json_stream/json_stream_samples/sample_json_reader.html"><strong aria-hidden="true">1.10.5.1.</strong> 使用 Json Stream 进行反序列化</a></li><li class="chapter-item "><a href="../../../encoding/json_stream/json_stream_samples/sample_json_writer.html"><strong aria-hidden="true">1.10.5.2.</strong> 使用 Json Stream 进行序列化</a></li><li class="chapter-item "><a href="../../../encoding/json_stream/json_stream_samples/sample_json_writeconfig.html"><strong aria-hidden="true">1.10.5.3.</strong> WriteConfig 使用示例</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../../encoding/url/url_package_overview.html"><strong aria-hidden="true">1.11.</strong> stdx.encoding.url</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../encoding/url/url_package_api/url_package_classes.html"><strong aria-hidden="true">1.11.1.</strong> 类</a></li><li class="chapter-item "><a href="../../../encoding/url/url_package_api/url_package_exceptions.html"><strong aria-hidden="true">1.11.2.</strong> 异常类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.11.3.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../encoding/url/url_samples/form.html"><strong aria-hidden="true">1.11.3.1.</strong> Form 的构造使用</a></li><li class="chapter-item "><a href="../../../encoding/url/url_samples/url_parse.html"><strong aria-hidden="true">1.11.3.2.</strong> URL 解析函数 parse 的使用</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../../fuzz/fuzz_package_overview.html"><strong aria-hidden="true">1.12.</strong> stdx.fuzz.fuzz</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../fuzz/fuzz_package_api/fuzz_package_constants_vars.html"><strong aria-hidden="true">1.12.1.</strong> 常量变量</a></li><li class="chapter-item "><a href="../../../fuzz/fuzz_package_api/fuzz_package_classes.html"><strong aria-hidden="true">1.12.2.</strong> 类</a></li><li class="chapter-item "><a href="../../../fuzz/fuzz_package_api/fuzz_package_exceptions.html"><strong aria-hidden="true">1.12.3.</strong> 异常类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.12.4.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../fuzz/fuzz_samples/basic_fuzzing_test.html"><strong aria-hidden="true">1.12.4.1.</strong> 测试猜测字符功能</a></li><li class="chapter-item "><a href="../../../fuzz/fuzz_samples/dataprovider_usage.html"><strong aria-hidden="true">1.12.4.2.</strong> 使用 DataProvider 功能进行测试</a></li><li class="chapter-item "><a href="../../../fuzz/fuzz_samples/fake_coverage_usage.html"><strong aria-hidden="true">1.12.4.3.</strong> 使用 FakeCoverage 避免 DataProvider 模式下 Fuzz 异常终止</a></li><li class="chapter-item "><a href="../../../fuzz/fuzz_samples/print_cj-fuzz_usage.html"><strong aria-hidden="true">1.12.4.4.</strong> 打印 fuzz 使用方法</a></li><li class="chapter-item "><a href="../../../fuzz/fuzz_samples/print_coverage.html"><strong aria-hidden="true">1.12.4.5.</strong> 实验性特性-覆盖率信息打印</a></li><li class="chapter-item "><a href="../../../fuzz/fuzz_samples/stack_backtrace_missing_solution.html"><strong aria-hidden="true">1.12.4.6.</strong> 栈回溯缺失的处理方案</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../../log/log_package_overview.html"><strong aria-hidden="true">1.13.</strong> stdx.log</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../log/log_package_api/log_package_types.html"><strong aria-hidden="true">1.13.1.</strong> 类型别名</a></li><li class="chapter-item "><a href="../../../log/log_package_api/log_package_funcs.html"><strong aria-hidden="true">1.13.2.</strong> 函数</a></li><li class="chapter-item "><a href="../../../log/log_package_api/log_package_interfaces.html"><strong aria-hidden="true">1.13.3.</strong> 接口</a></li><li class="chapter-item "><a href="../../../log/log_package_api/log_package_classes.html"><strong aria-hidden="true">1.13.4.</strong> 类</a></li><li class="chapter-item "><a href="../../../log/log_package_api/log_package_structs.html"><strong aria-hidden="true">1.13.5.</strong> 结构体</a></li><li class="chapter-item "><a href="../../../log/log_package_api/log_package_exceptions.html"><strong aria-hidden="true">1.13.6.</strong> 异常类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.13.7.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../log/log_samples/log_sample.html"><strong aria-hidden="true">1.13.7.1.</strong> 日志打印示例</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../../logger/logger_package_overview.html"><strong aria-hidden="true">1.14.</strong> stdx.logger</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../logger/logger_package_api/logger_package_classes.html"><strong aria-hidden="true">1.14.1.</strong> 类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.14.2.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../logger/logger_samples/logger_sample.html"><strong aria-hidden="true">1.14.2.1.</strong> 日志打印示例</a></li></ol></li></ol></li><li class="chapter-item expanded "><a href="../../../net/http/http_package_overview.html"><strong aria-hidden="true">1.15.</strong> stdx.net.http</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../net/http/http_package_api/http_package_funcs.html"><strong aria-hidden="true">1.15.1.</strong> 函数</a></li><li class="chapter-item "><a href="../../../net/http/http_package_api/http_package_interfaces.html"><strong aria-hidden="true">1.15.2.</strong> 接口</a></li><li class="chapter-item "><a href="../../../net/http/http_package_api/http_package_classes.html"><strong aria-hidden="true">1.15.3.</strong> 类</a></li><li class="chapter-item "><a href="../../../net/http/http_package_api/http_package_enums.html"><strong aria-hidden="true">1.15.4.</strong> 枚举</a></li><li class="chapter-item expanded "><a href="../../../net/http/http_package_api/http_package_structs.html" class="active"><strong aria-hidden="true">1.15.5.</strong> 结构体</a></li><li class="chapter-item "><a href="../../../net/http/http_package_api/http_package_exceptions.html"><strong aria-hidden="true">1.15.6.</strong> 异常类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.15.7.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../net/http/http_samples/http_client.html"><strong aria-hidden="true">1.15.7.1.</strong> client</a></li><li class="chapter-item "><a href="../../../net/http/http_samples/cookie.html"><strong aria-hidden="true">1.15.7.2.</strong> cookie</a></li><li class="chapter-item "><a href="../../../net/http/http_samples/log.html"><strong aria-hidden="true">1.15.7.3.</strong> log</a></li><li class="chapter-item "><a href="../../../net/http/http_samples/http_server.html"><strong aria-hidden="true">1.15.7.4.</strong> server</a></li><li class="chapter-item "><a href="../../../net/http/http_samples/webSocket.html"><strong aria-hidden="true">1.15.7.5.</strong> webSocket</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../../net/tls/tls_package_overview.html"><strong aria-hidden="true">1.16.</strong> stdx.net.tls</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../net/tls/tls_package_api/tls_package_classes.html"><strong aria-hidden="true">1.16.1.</strong> 类</a></li><li class="chapter-item "><a href="../../../net/tls/tls_package_api/tls_package_enums.html"><strong aria-hidden="true">1.16.2.</strong> 枚举</a></li><li class="chapter-item "><a href="../../../net/tls/tls_package_api/tls_package_structs.html"><strong aria-hidden="true">1.16.3.</strong> 结构体</a></li><li class="chapter-item "><a href="../../../net/tls/tls_package_api/tls_package_exceptions.html"><strong aria-hidden="true">1.16.4.</strong> 异常类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.16.5.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../net/tls/tls_samples/cert_key.html"><strong aria-hidden="true">1.16.5.1.</strong> 服务端证书及公钥在一份文件中</a></li><li class="chapter-item "><a href="../../../net/tls/tls_samples/client.html"><strong aria-hidden="true">1.16.5.2.</strong> 客户端示例</a></li><li class="chapter-item "><a href="../../../net/tls/tls_samples/hot_update_cert.html"><strong aria-hidden="true">1.16.5.3.</strong> 证书热更新</a></li><li class="chapter-item "><a href="../../../net/tls/tls_samples/server.html"><strong aria-hidden="true">1.16.5.4.</strong> 服务端示例</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../../serialization/serialization_package_overview.html"><strong aria-hidden="true">1.17.</strong> stdx.serialization.serialization</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../serialization/serialization_package_api/serialization_package_functions.html"><strong aria-hidden="true">1.17.1.</strong> 函数</a></li><li class="chapter-item "><a href="../../../serialization/serialization_package_api/serialization_package_interfaces.html"><strong aria-hidden="true">1.17.2.</strong> 接口</a></li><li class="chapter-item "><a href="../../../serialization/serialization_package_api/serialization_package_classes.html"><strong aria-hidden="true">1.17.3.</strong> 类</a></li><li class="chapter-item "><a href="../../../serialization/serialization_package_api/serialization_package_exceptions.html"><strong aria-hidden="true">1.17.4.</strong> 异常类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.17.5.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../serialization/serialization_samples/serialize_and_deserialize_class.html"><strong aria-hidden="true">1.17.5.1.</strong> class 序列化和反序列化</a></li><li class="chapter-item "><a href="../../../serialization/serialization_samples/serialize_hashmap_and_hashset.html"><strong aria-hidden="true">1.17.5.2.</strong> HashSet 和 HashMap 序列化</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../../unittest/data/data_package_overview.html"><strong aria-hidden="true">1.18.</strong> stdx.unittest.data</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../../unittest/data/data_package_api/data_package_functions.html"><strong aria-hidden="true">1.18.1.</strong> 函数</a></li><li class="chapter-item "><a href="../../../unittest/data/data_package_api/data_package_classes.html"><strong aria-hidden="true">1.18.2.</strong> 类</a></li></ol></li></ol></li></ol>
            </div>
            <div id="sidebar-resize-handle" class="sidebar-resize-handle">
                <div class="sidebar-resize-indicator"></div>
            </div>
        </nav>

        <!-- Track and set sidebar scroll position -->
        <script>
            var sidebarScrollbox = document.querySelector('#sidebar .sidebar-scrollbox');
            sidebarScrollbox.addEventListener('click', function(e) {
                if (e.target.tagName === 'A') {
                    sessionStorage.setItem('sidebar-scroll', sidebarScrollbox.scrollTop);
                }
            }, { passive: true });
            var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll');
            sessionStorage.removeItem('sidebar-scroll');
            if (sidebarScrollTop) {
                // preserve sidebar scroll position when navigating via links within sidebar
                sidebarScrollbox.scrollTop = sidebarScrollTop;
            } else {
                // scroll sidebar to current active section when navigating via "next/previous chapter" buttons
                var activeSection = document.querySelector('#sidebar .active');
                if (activeSection) {
                    activeSection.scrollIntoView({ block: 'center' });
                }
            }
        </script>

        <div id="page-wrapper" class="page-wrapper">

            <div class="page">
                                <div id="menu-bar-hover-placeholder"></div>
                <div id="menu-bar" class="menu-bar sticky">
                    <div class="left-buttons">
                        <label id="sidebar-toggle" class="icon-button" for="sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
                            <i class="fa fa-bars"></i>
                        </label>
                        <button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
                            <i class="fa fa-paint-brush"></i>
                        </button>
                        <ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
                            <li role="none"><button role="menuitem" class="theme" id="light">Light</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
                        </ul>
                        <button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">
                            <i class="fa fa-search"></i>
                        </button>
                    </div>

                    <h1 class="menu-title">仓颉编程语言扩展库 API</h1>

                    <div class="right-buttons">
                        <a href="../../../print.html" title="Print this book" aria-label="Print this book">
                            <i id="print-button" class="fa fa-print"></i>
                        </a>

                    </div>
                </div>

                <div id="search-wrapper" class="hidden">
                    <form id="searchbar-outer" class="searchbar-outer">
                        <input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
                    </form>
                    <div id="searchresults-outer" class="searchresults-outer hidden">
                        <div id="searchresults-header" class="searchresults-header"></div>
                        <ul id="searchresults">
                        </ul>
                    </div>
                </div>

                <!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
                <script>
                    document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
                    document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
                    Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
                        link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
                    });
                </script>

                <div id="content" class="content">
                    <main>
                        <h1 id="结构体"><a class="header" href="#结构体">结构体</a></h1>
<h2 id="struct-httpstatuscode"><a class="header" href="#struct-httpstatuscode">struct HttpStatusCode</a></h2>
<pre><code class="language-cangjie">public struct HttpStatusCode {
    public static const STATUS_CONTINUE: UInt16 =                        100
    public static const STATUS_SWITCHING_PROTOCOLS: UInt16 =             101
    public static const STATUS_PROCESSING: UInt16 =                      102
    public static const STATUS_EARLY_HINTS: UInt16 =                     103
 
    public static const STATUS_OK: UInt16 =                              200
    public static const STATUS_CREATED: UInt16 =                         201
    public static const STATUS_ACCEPTED: UInt16 =                        202
    public static const STATUS_NON_AUTHORITATIVE_INFO: UInt16 =          203
    public static const STATUS_NO_CONTENT: UInt16 =                      204
    public static const STATUS_RESET_CONTENT: UInt16 =                   205
    public static const STATUS_PARTIAL_CONTENT: UInt16 =                 206
    public static const STATUS_MULTI_STATUS: UInt16 =                    207
    public static const STATUS_ALREADY_REPORTED: UInt16 =                208
    public static const STATUS_IM_USED: UInt16 =                         226
 
    public static const STATUS_MULTIPLE_CHOICES: UInt16 =                300
    public static const STATUS_MOVED_PERMANENTLY: UInt16 =               301
    public static const STATUS_FOUND: UInt16 =                           302
    public static const STATUS_SEE_OTHER: UInt16 =                       303
    public static const STATUS_NOT_MODIFIED: UInt16 =                    304
    public static const STATUS_USE_PROXY: UInt16 =                       305
    public static const STATUS_TEMPORARY_REDIRECT: UInt16 =              307
    public static const STATUS_PERMANENT_REDIRECT: UInt16 =              308
 
    public static const STATUS_BAD_REQUEST: UInt16 =                     400
    public static const STATUS_UNAUTHORIZED: UInt16 =                    401
    public static const STATUS_PAYMENT_REQUIRED: UInt16 =                402
    public static const STATUS_FORBIDDEN: UInt16 =                       403
    public static const STATUS_NOT_FOUND: UInt16 =                       404
    public static const STATUS_METHOD_NOT_ALLOWED: UInt16 =              405
    public static const STATUS_NOT_ACCEPTABLE: UInt16 =                  406
    public static const STATUS_PROXY_AUTH_REQUIRED: UInt16 =             407
    public static const STATUS_REQUEST_TIMEOUT: UInt16 =                 408
    public static const STATUS_CONFLICT: UInt16 =                        409
    public static const STATUS_GONE: UInt16 =                            410
    public static const STATUS_LENGTH_REQUIRED: UInt16 =                 411
    public static const STATUS_PRECONDITION_FAILED: UInt16 =             412
    public static const STATUS_REQUEST_CONTENT_TOO_LARGE: UInt16 =       413
    public static const STATUS_REQUEST_URI_TOO_LONG: UInt16 =            414
    public static const STATUS_UNSUPPORTED_MEDIA_TYPE: UInt16 =          415
    public static const STATUS_REQUESTED_RANGE_NOT_SATISFIABLE: UInt16 = 416
    public static const STATUS_EXPECTATION_FAILED: UInt16 =              417
    public static const STATUS_TEAPOT: UInt16 =                          418
    public static const STATUS_MISDIRECTED_REQUEST: UInt16 =             421
    public static const STATUS_UNPROCESSABLE_ENTITY: UInt16 =            422
    public static const STATUS_LOCKED: UInt16 =                          423
    public static const STATUS_FAILED_DEPENDENCY: UInt16 =               424
    public static const STATUS_TOO_EARLY: UInt16 =                       425
    public static const STATUS_UPGRADE_REQUIRED: UInt16 =                426
    public static const STATUS_PRECONDITION_REQUIRED: UInt16 =           428
    public static const STATUS_TOO_MANY_REQUESTS: UInt16 =               429
    public static const STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: UInt16 = 431
    public static const STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: UInt16 =   451
 
    public static const STATUS_INTERNAL_SERVER_ERROR: UInt16 =           500
    public static const STATUS_NOT_IMPLEMENTED: UInt16 =                 501
    public static const STATUS_BAD_GATEWAY: UInt16 =                     502
    public static const STATUS_SERVICE_UNAVAILABLE: UInt16 =             503
    public static const STATUS_GATEWAY_TIMEOUT: UInt16 =                 504
    public static const STATUS_HTTP_VERSION_NOT_SUPPORTED: UInt16 =      505
    public static const STATUS_VARIANT_ALSO_NEGOTIATES: UInt16 =         506
    public static const STATUS_INSUFFICIENT_STORAGE: UInt16 =            507
    public static const STATUS_LOOP_DETECTED: UInt16 =                   508
    public static const STATUS_NOT_EXTENDED: UInt16 =                    510
    public static const STATUS_NETWORK_AUTHENTICATION_REQUIRED: UInt16 = 511
}
</code></pre>
<p>功能：用来表示网页服务器超文本传输协议响应状态的 3 位数字代码。</p>
<p>状态码由 RFC 9110 规范定义，并得到 RFC2518、RFC 3229、RFC 4918、RFC 5842、RFC 7168 与 RFC 8297 等规范扩展。</p>
<p>所有状态码的第一个数字代表了响应的五种状态之一：</p>
<ul>
<li>状态代码的 1xx（信息）指示在完成请求的操作并发送最终响应之前通信连接状态或请求进度的临时响应。</li>
<li>状态代码的 2xx（成功）指示客户端的请求已成功接收、理解和接受。</li>
<li>状态代码的 3xx（重定向）指示用户代理需要采取进一步的操作才能完成请求。</li>
<li>状态代码的 4xx（客户端错误）指示客户端似乎出错。</li>
<li>状态代码的 5xx（服务器错误）指示服务器意识到它出错或无法执行请求的方法。</li>
</ul>
<h3 id="static-const-status_accepted"><a class="header" href="#static-const-status_accepted">static const STATUS_ACCEPTED</a></h3>
<pre><code class="language-cangjie">public static const STATUS_ACCEPTED: UInt16 = 202
</code></pre>
<p>功能：服务器已接受请求，但尚未处理。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_already_reported"><a class="header" href="#static-const-status_already_reported">static const STATUS_ALREADY_REPORTED</a></h3>
<pre><code class="language-cangjie">public static const STATUS_ALREADY_REPORTED: UInt16 = 208
</code></pre>
<p>功能：消息体将是一个 XML 消息。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_bad_gateway"><a class="header" href="#static-const-status_bad_gateway">static const STATUS_BAD_GATEWAY</a></h3>
<pre><code class="language-cangjie">public static const STATUS_BAD_GATEWAY: UInt16 = 502
</code></pre>
<p>功能：作为网关或者代理工作的服务器尝试执行请求时，从上游服务器接收到无效的响应。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_bad_request"><a class="header" href="#static-const-status_bad_request">static const STATUS_BAD_REQUEST</a></h3>
<pre><code class="language-cangjie">public static const STATUS_BAD_REQUEST: UInt16 = 400
</code></pre>
<p>功能：语义有误，当前请求无法被服务器理解；或请求参数有误。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_conflict"><a class="header" href="#static-const-status_conflict">static const STATUS_CONFLICT</a></h3>
<pre><code class="language-cangjie">public static const STATUS_CONFLICT: UInt16 = 409
</code></pre>
<p>功能：由于和被请求的资源的当前状态之间存在冲突，请求无法完成。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_continue"><a class="header" href="#static-const-status_continue">static const STATUS_CONTINUE</a></h3>
<pre><code class="language-cangjie">public static const STATUS_CONTINUE: UInt16 = 100
</code></pre>
<p>功能：这个临时响应是用来通知客户端它的部分请求已经被服务器接收，且仍未被拒绝。</p>
<p>类型：Int64</p>
<blockquote>
<p><strong>说明：</strong></p>
<p>客户端应当继续发送请求的剩余部分，或者如果请求已经完成，忽略这个响应。
服务器必须在请求完成后向客户端发送一个最终响应。</p>
</blockquote>
<h3 id="static-const-status_created"><a class="header" href="#static-const-status_created">static const STATUS_CREATED</a></h3>
<pre><code class="language-cangjie">public static const STATUS_CREATED: UInt16 = 201
</code></pre>
<p>功能：请求已经被实现，而且有一个新的资源已经依据请求的需要而建立，且其 URI 已经随 Location 头信息返回。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_early_hints"><a class="header" href="#static-const-status_early_hints">static const STATUS_EARLY_HINTS</a></h3>
<pre><code class="language-cangjie">public static const STATUS_EARLY_HINTS: UInt16 = 103
</code></pre>
<p>功能：提前预加载 (css、js) 文档。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_expectation_failed"><a class="header" href="#static-const-status_expectation_failed">static const STATUS_EXPECTATION_FAILED</a></h3>
<pre><code class="language-cangjie">public static const STATUS_EXPECTATION_FAILED: UInt16 = 417
</code></pre>
<p>功能：服务器无法满足 Expect 的请求头信息。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_failed_dependency"><a class="header" href="#static-const-status_failed_dependency">static const STATUS_FAILED_DEPENDENCY</a></h3>
<pre><code class="language-cangjie">public static const STATUS_FAILED_DEPENDENCY: UInt16 = 424
</code></pre>
<p>功能：由于之前的某个请求发生的错误，导致当前请求失败。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_forbidden"><a class="header" href="#static-const-status_forbidden">static const STATUS_FORBIDDEN</a></h3>
<pre><code class="language-cangjie">public static const STATUS_FORBIDDEN: UInt16 = 403
</code></pre>
<p>功能：服务器已经理解请求，但是拒绝执行。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_found"><a class="header" href="#static-const-status_found">static const STATUS_FOUND</a></h3>
<pre><code class="language-cangjie">public static const STATUS_FOUND: UInt16 = 302
</code></pre>
<p>功能：临时移动。</p>
<p>类型：Int64</p>
<blockquote>
<p><strong>说明：</strong></p>
<p>请求的资源已被临时的移动到新 URI，客户端应当继续向原有地址发送以后的请求。</p>
</blockquote>
<h3 id="static-const-status_gateway_timeout"><a class="header" href="#static-const-status_gateway_timeout">static const STATUS_GATEWAY_TIMEOUT</a></h3>
<pre><code class="language-cangjie">public static const STATUS_GATEWAY_TIMEOUT: UInt16 = 504
</code></pre>
<p>功能：从上游服务器（URI 标识出的服务器，例如 HTTP、FTP、LDAP）或者辅助服务器（例如 DNS）收到响应超时。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_gone"><a class="header" href="#static-const-status_gone">static const STATUS_GONE</a></h3>
<pre><code class="language-cangjie">public static const STATUS_GONE: UInt16 = 410
</code></pre>
<p>功能：被请求的资源在服务器上已经不再可用，而且没有任何已知的转发地址。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_http_version_not_supported"><a class="header" href="#static-const-status_http_version_not_supported">static const STATUS_HTTP_VERSION_NOT_SUPPORTED</a></h3>
<pre><code class="language-cangjie">public static const STATUS_HTTP_VERSION_NOT_SUPPORTED: UInt16 = 505
</code></pre>
<p>功能：服务器不支持，或者拒绝支持在请求中使用的 HTTP 版本。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_im_used"><a class="header" href="#static-const-status_im_used">static const STATUS_IM_USED</a></h3>
<pre><code class="language-cangjie">public static const STATUS_IM_USED: UInt16 = 226
</code></pre>
<p>功能：服务器已完成对资源的请求，并且响应是应用于当前实例的一个或多个实例操作的结果的表示。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_insufficient_storage"><a class="header" href="#static-const-status_insufficient_storage">static const STATUS_INSUFFICIENT_STORAGE</a></h3>
<pre><code class="language-cangjie">public static const STATUS_INSUFFICIENT_STORAGE: UInt16 = 507
</code></pre>
<p>功能：服务器无法存储完成请求所必须的内容。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_internal_server_error"><a class="header" href="#static-const-status_internal_server_error">static const STATUS_INTERNAL_SERVER_ERROR</a></h3>
<pre><code class="language-cangjie">public static const STATUS_INTERNAL_SERVER_ERROR: UInt16 = 500
</code></pre>
<p>功能：服务器遇到了一个未曾预料的状况，导致了它无法完成对请求的处理。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_length_required"><a class="header" href="#static-const-status_length_required">static const STATUS_LENGTH_REQUIRED</a></h3>
<pre><code class="language-cangjie">public static const STATUS_LENGTH_REQUIRED: UInt16 = 411
</code></pre>
<p>功能：服务器拒绝在没有定义 Content-Length 头的情况下接受请求。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_locked"><a class="header" href="#static-const-status_locked">static const STATUS_LOCKED</a></h3>
<pre><code class="language-cangjie">public static const STATUS_LOCKED: UInt16 = 423
</code></pre>
<p>功能：当前资源被锁定。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_loop_detected"><a class="header" href="#static-const-status_loop_detected">static const STATUS_LOOP_DETECTED</a></h3>
<pre><code class="language-cangjie">public static const STATUS_LOOP_DETECTED: UInt16 = 508
</code></pre>
<p>功能：服务器在处理请求时检测到无限递归。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_method_not_allowed"><a class="header" href="#static-const-status_method_not_allowed">static const STATUS_METHOD_NOT_ALLOWED</a></h3>
<pre><code class="language-cangjie">public static const STATUS_METHOD_NOT_ALLOWED: UInt16 = 405
</code></pre>
<p>功能：请求行中指定的请求函数不能被用于请求响应的资源。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_misdirected_request"><a class="header" href="#static-const-status_misdirected_request">static const STATUS_MISDIRECTED_REQUEST</a></h3>
<pre><code class="language-cangjie">public static const STATUS_MISDIRECTED_REQUEST: UInt16 = 421
</code></pre>
<p>功能：请求被指向到无法生成响应的服务器。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_moved_permanently"><a class="header" href="#static-const-status_moved_permanently">static const STATUS_MOVED_PERMANENTLY</a></h3>
<pre><code class="language-cangjie">public static const STATUS_MOVED_PERMANENTLY: UInt16 = 301
</code></pre>
<p>功能：永久移动。</p>
<p>类型：Int64</p>
<blockquote>
<p><strong>说明：</strong></p>
<p>请求的资源已被永久的移动到新 URI，返回信息会包括新的 URI，浏览器会自动定向到新 URI。</p>
</blockquote>
<h3 id="static-const-status_multiple_choices"><a class="header" href="#static-const-status_multiple_choices">static const STATUS_MULTIPLE_CHOICES</a></h3>
<pre><code class="language-cangjie">public static const STATUS_MULTIPLE_CHOICES: UInt16 = 300
</code></pre>
<p>功能：被请求的资源有一系列可供选择的回馈信息，每个都有自己特定的地址和浏览器驱动的商议信息。</p>
<p>类型：Int64</p>
<blockquote>
<p><strong>说明：</strong></p>
<p>用户或浏览器能够自行选择一个首选的地址进行重定向。</p>
</blockquote>
<h3 id="static-const-status_multi_status"><a class="header" href="#static-const-status_multi_status">static const STATUS_MULTI_STATUS</a></h3>
<pre><code class="language-cangjie">public static const STATUS_MULTI_STATUS: UInt16 = 207
</code></pre>
<p>功能：DAV 绑定的成员已经在（多状态）响应之前的部分被列举，且未被再次包含。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_network_authentication_required"><a class="header" href="#static-const-status_network_authentication_required">static const STATUS_NETWORK_AUTHENTICATION_REQUIRED</a></h3>
<pre><code class="language-cangjie">public static const STATUS_NETWORK_AUTHENTICATION_REQUIRED: UInt16 = 511
</code></pre>
<p>功能：要求网络认证。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_non_authoritative_info"><a class="header" href="#static-const-status_non_authoritative_info">static const STATUS_NON_AUTHORITATIVE_INFO</a></h3>
<pre><code class="language-cangjie">public static const STATUS_NON_AUTHORITATIVE_INFO: UInt16 = 203
</code></pre>
<p>功能：服务器已成功处理了请求。</p>
<p>类型：Int64</p>
<blockquote>
<p><strong>说明：</strong></p>
<p>返回的实体头部元信息不是在原始服务器上有效的确定集合，而是来自本地或者第三方的拷贝。</p>
</blockquote>
<h3 id="static-const-status_not_acceptable"><a class="header" href="#static-const-status_not_acceptable">static const STATUS_NOT_ACCEPTABLE</a></h3>
<pre><code class="language-cangjie">public static const STATUS_NOT_ACCEPTABLE: UInt16 = 406
</code></pre>
<p>功能：请求的资源的内容特性无法满足请求头中的条件，因而无法生成响应实体。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_not_extended"><a class="header" href="#static-const-status_not_extended">static const STATUS_NOT_EXTENDED</a></h3>
<pre><code class="language-cangjie">public static const STATUS_NOT_EXTENDED: UInt16 = 510
</code></pre>
<p>功能：获取资源所需要的策略并没有被满足。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_not_found"><a class="header" href="#static-const-status_not_found">static const STATUS_NOT_FOUND</a></h3>
<pre><code class="language-cangjie">public static const STATUS_NOT_FOUND: UInt16 = 404
</code></pre>
<p>功能：请求失败，请求所希望得到的资源未被在服务器上发现。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_not_implemented"><a class="header" href="#static-const-status_not_implemented">static const STATUS_NOT_IMPLEMENTED</a></h3>
<pre><code class="language-cangjie">public static const STATUS_NOT_IMPLEMENTED: UInt16 = 501
</code></pre>
<p>功能：服务器不支持当前请求所需要的某个功能。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_not_modified"><a class="header" href="#static-const-status_not_modified">static const STATUS_NOT_MODIFIED</a></h3>
<pre><code class="language-cangjie">public static const STATUS_NOT_MODIFIED: UInt16 = 304
</code></pre>
<p>功能：请求的资源未修改，服务器返回此状态码时，不会返回任何资源。</p>
<p>类型：Int64</p>
<blockquote>
<p><strong>说明：</strong></p>
<p>客户端通常会缓存访问过的资源，通过提供一个头信息指出客户端希望只返回在指定日期之后修改的资源。</p>
</blockquote>
<h3 id="static-const-status_no_content"><a class="header" href="#static-const-status_no_content">static const STATUS_NO_CONTENT</a></h3>
<pre><code class="language-cangjie">public static const STATUS_NO_CONTENT: UInt16 = 204
</code></pre>
<p>功能：服务器成功处理，但未返回内容。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_ok"><a class="header" href="#static-const-status_ok">static const STATUS_OK</a></h3>
<pre><code class="language-cangjie">public static const STATUS_OK: UInt16 = 200
</code></pre>
<p>功能：请求已经成功，请求所希望的响应头或数据体将随此响应返回。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_partial_content"><a class="header" href="#static-const-status_partial_content">static const STATUS_PARTIAL_CONTENT</a></h3>
<pre><code class="language-cangjie">public static const STATUS_PARTIAL_CONTENT: UInt16 = 206
</code></pre>
<p>功能：服务器已经成功处理了部分 GET 请求。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_payment_required"><a class="header" href="#static-const-status_payment_required">static const STATUS_PAYMENT_REQUIRED</a></h3>
<pre><code class="language-cangjie">public static const STATUS_PAYMENT_REQUIRED: UInt16 = 402
</code></pre>
<p>功能：为了将来可能的需求而预留的状态码。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_permanent_redirect"><a class="header" href="#static-const-status_permanent_redirect">static const STATUS_PERMANENT_REDIRECT</a></h3>
<pre><code class="language-cangjie">public static const STATUS_PERMANENT_REDIRECT: UInt16 = 308
</code></pre>
<p>功能：请求和所有将来的请求应该使用另一个 URI。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_precondition_failed"><a class="header" href="#static-const-status_precondition_failed">static const STATUS_PRECONDITION_FAILED</a></h3>
<pre><code class="language-cangjie">public static const STATUS_PRECONDITION_FAILED: UInt16 = 412
</code></pre>
<p>功能：服务器在验证在请求的头字段中给出先决条件时，没能满足其中的一个或多个。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_precondition_required"><a class="header" href="#static-const-status_precondition_required">static const STATUS_PRECONDITION_REQUIRED</a></h3>
<pre><code class="language-cangjie">public static const STATUS_PRECONDITION_REQUIRED: UInt16 = 428
</code></pre>
<p>功能：客户端发送 HTTP 请求时，必须要满足的一些预设条件。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_processing"><a class="header" href="#static-const-status_processing">static const STATUS_PROCESSING</a></h3>
<pre><code class="language-cangjie">public static const STATUS_PROCESSING: UInt16 = 102
</code></pre>
<p>功能：处理将被继续执行。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_proxy_auth_required"><a class="header" href="#static-const-status_proxy_auth_required">static const STATUS_PROXY_AUTH_REQUIRED</a></h3>
<pre><code class="language-cangjie">public static const STATUS_PROXY_AUTH_REQUIRED: UInt16 = 407
</code></pre>
<p>功能：必须在代理服务器上进行身份验证。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_requested_range_not_satisfiable"><a class="header" href="#static-const-status_requested_range_not_satisfiable">static const STATUS_REQUESTED_RANGE_NOT_SATISFIABLE</a></h3>
<pre><code class="language-cangjie">public static const STATUS_REQUESTED_RANGE_NOT_SATISFIABLE: UInt16 = 416
</code></pre>
<p>功能：客户端请求的范围无效。</p>
<p>类型：Int64</p>
<blockquote>
<p><strong>说明：</strong></p>
<p>请求中包含了 <code>Range</code> 请求头，并且 <code>Range</code> 中指定的任何数据范围都与当前资源的可用范围不重合；
同时请求中又没有定义 <code>If-Range</code> 请求头。</p>
</blockquote>
<h3 id="static-const-status_request_content_too_large"><a class="header" href="#static-const-status_request_content_too_large">static const STATUS_REQUEST_CONTENT_TOO_LARGE</a></h3>
<pre><code class="language-cangjie">public static const STATUS_REQUEST_CONTENT_TOO_LARGE: UInt16 = 413
</code></pre>
<p>功能：请求提交的实体数据大小超过了服务器愿意或者能够处理的范围。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_request_header_fields_too_large"><a class="header" href="#static-const-status_request_header_fields_too_large">static const STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE</a></h3>
<pre><code class="language-cangjie">public static const STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: UInt16 = 431
</code></pre>
<p>功能：请求头字段太大。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_request_timeout"><a class="header" href="#static-const-status_request_timeout">static const STATUS_REQUEST_TIMEOUT</a></h3>
<pre><code class="language-cangjie">public static const STATUS_REQUEST_TIMEOUT: UInt16 = 408
</code></pre>
<p>功能：请求超时。客户端没有在服务器预备等待的时间内完成一个请求的发送。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_request_uri_too_long"><a class="header" href="#static-const-status_request_uri_too_long">static const STATUS_REQUEST_URI_TOO_LONG</a></h3>
<pre><code class="language-cangjie">public static const STATUS_REQUEST_URI_TOO_LONG: UInt16 = 414
</code></pre>
<p>功能：求的 URI 长度超过了服务器能够解释的长度。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_reset_content"><a class="header" href="#static-const-status_reset_content">static const STATUS_RESET_CONTENT</a></h3>
<pre><code class="language-cangjie">public static const STATUS_RESET_CONTENT: UInt16 = 205
</code></pre>
<p>功能：服务器成功处理了请求，且没有返回任何内容，希望请求者重置文档视图。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_see_other"><a class="header" href="#static-const-status_see_other">static const STATUS_SEE_OTHER</a></h3>
<pre><code class="language-cangjie">public static const STATUS_SEE_OTHER: UInt16 = 303
</code></pre>
<p>功能：对应当前请求的响应可以在另一个 <a href="../../../encoding/url/url_package_api/url_package_classes.html#class-url">URL</a> 上被找到，而且客户端应当采用 GET 的方式访问那个资源。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_service_unavailable"><a class="header" href="#static-const-status_service_unavailable">static const STATUS_SERVICE_UNAVAILABLE</a></h3>
<pre><code class="language-cangjie">public static const STATUS_SERVICE_UNAVAILABLE: UInt16 = 503
</code></pre>
<p>功能：临时的服务器维护或者过载。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_switching_protocols"><a class="header" href="#static-const-status_switching_protocols">static const STATUS_SWITCHING_PROTOCOLS</a></h3>
<pre><code class="language-cangjie">public static const STATUS_SWITCHING_PROTOCOLS: UInt16 = 101
</code></pre>
<p>功能：服务器已经理解了客户端的请求，并将通过 Upgrade 消息头通知客户端采用不同的协议来完成这个请求。</p>
<p>类型：Int64</p>
<blockquote>
<p><strong>说明：</strong></p>
<p>在发送完这个响应最后的空行后，服务器将会切换到在 Upgrade 消息头中定义的那些协议。</p>
</blockquote>
<h3 id="static-const-status_teapot"><a class="header" href="#static-const-status_teapot">static const STATUS_TEAPOT</a></h3>
<pre><code class="language-cangjie">public static const STATUS_TEAPOT: UInt16 = 418
</code></pre>
<p>功能：服务端无法处理请求，一个愚弄客户端的状态码，被称为“我是茶壶”错误码，不应被认真对待。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_temporary_redirect"><a class="header" href="#static-const-status_temporary_redirect">static const STATUS_TEMPORARY_REDIRECT</a></h3>
<pre><code class="language-cangjie">public static const STATUS_TEMPORARY_REDIRECT: UInt16 = 307
</code></pre>
<p>功能：临时重定向。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_too_early"><a class="header" href="#static-const-status_too_early">static const STATUS_TOO_EARLY</a></h3>
<pre><code class="language-cangjie">public static const STATUS_TOO_EARLY: UInt16 = 425
</code></pre>
<p>功能：服务器不愿意冒风险来处理该请求。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_too_many_requests"><a class="header" href="#static-const-status_too_many_requests">static const STATUS_TOO_MANY_REQUESTS</a></h3>
<pre><code class="language-cangjie">public static const STATUS_TOO_MANY_REQUESTS: UInt16 = 429
</code></pre>
<p>功能：请求过多。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_unauthorized"><a class="header" href="#static-const-status_unauthorized">static const STATUS_UNAUTHORIZED</a></h3>
<pre><code class="language-cangjie">public static const STATUS_UNAUTHORIZED: UInt16 = 401
</code></pre>
<p>功能：当前请求需要用户验证。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_unavailable_for_legal_reasons"><a class="header" href="#static-const-status_unavailable_for_legal_reasons">static const STATUS_UNAVAILABLE_FOR_LEGAL_REASONS</a></h3>
<pre><code class="language-cangjie">public static const STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: UInt16 = 451
</code></pre>
<p>功能：该请求因法律原因不可用。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_unprocessable_entity"><a class="header" href="#static-const-status_unprocessable_entity">static const STATUS_UNPROCESSABLE_ENTITY</a></h3>
<pre><code class="language-cangjie">public static const STATUS_UNPROCESSABLE_ENTITY: UInt16 = 422
</code></pre>
<p>功能：请求格式正确，但是由于含有语义错误，无法响应。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_unsupported_media_type"><a class="header" href="#static-const-status_unsupported_media_type">static const STATUS_UNSUPPORTED_MEDIA_TYPE</a></h3>
<pre><code class="language-cangjie">public static const STATUS_UNSUPPORTED_MEDIA_TYPE: UInt16 = 415
</code></pre>
<p>功能：服务器无法处理请求附带的媒体格式。</p>
<p>类型：Int64</p>
<blockquote>
<p><strong>说明：</strong></p>
<p>对于当前请求的函数和所请求的资源，请求中提交的实体并不是服务器中所支持的格式。</p>
</blockquote>
<h3 id="static-const-status_upgrade_required"><a class="header" href="#static-const-status_upgrade_required">static const STATUS_UPGRADE_REQUIRED</a></h3>
<pre><code class="language-cangjie">public static const STATUS_UPGRADE_REQUIRED: UInt16 = 426
</code></pre>
<p>功能：服务器拒绝处理客户端使用当前协议发送的请求，但是可以接受其使用升级后的协议发送的请求。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_use_proxy"><a class="header" href="#static-const-status_use_proxy">static const STATUS_USE_PROXY</a></h3>
<pre><code class="language-cangjie">public static const STATUS_USE_PROXY: UInt16 = 305
</code></pre>
<p>功能：使用代理，所请求的资源必须通过代理访问。</p>
<p>类型：Int64</p>
<h3 id="static-const-status_variant_also_negotiates"><a class="header" href="#static-const-status_variant_also_negotiates">static const STATUS_VARIANT_ALSO_NEGOTIATES</a></h3>
<pre><code class="language-cangjie">public static const STATUS_VARIANT_ALSO_NEGOTIATES: UInt16 = 506
</code></pre>
<p>功能：服务器存在内部配置错误。</p>
<p>类型：Int64</p>
<h2 id="struct-servicepoolconfig"><a class="header" href="#struct-servicepoolconfig">struct ServicePoolConfig</a></h2>
<pre><code class="language-cangjie">public struct ServicePoolConfig {
    public let capacity: Int64
    public let queueCapacity: Int64
    public let preheat: Int64
    public init(capacity!: Int64 = 10 ** 4, queueCapacity!: Int64 = 10 ** 4, preheat!: Int64 = 0)
}
</code></pre>
<p>功能：Http <a href="http_package_classes.html#class-server">Server</a> 协程池配置。</p>
<blockquote>
<p><strong>说明：</strong></p>
<p>HTTP/1.1 <a href="http_package_classes.html#class-server">Server</a> 每次收到一个请求，将从协程池取出一个协程进行处理，如果任务等待队列已满，将拒绝服务该次请求，并断开连接。
HTTP/2 <a href="http_package_classes.html#class-server">Server</a> 处理过程中会从协程池取出若干协程进行处理，如果任务等待队列已满，将阻塞直至有协程空闲。</p>
</blockquote>
<h3 id="let-capacity"><a class="header" href="#let-capacity">let capacity</a></h3>
<pre><code class="language-cangjie">public let capacity: Int64
</code></pre>
<p>功能：获取协程池容量。</p>
<p>类型：Int64</p>
<h3 id="let-preheat"><a class="header" href="#let-preheat">let preheat</a></h3>
<pre><code class="language-cangjie">public let preheat: Int64
</code></pre>
<p>功能：获取服务启动时预先启动的协程数量。</p>
<p>类型：Int64</p>
<h3 id="let-queuecapacity"><a class="header" href="#let-queuecapacity">let queueCapacity</a></h3>
<pre><code class="language-cangjie">public let queueCapacity: Int64
</code></pre>
<p>功能：获取缓冲区等待任务的最大数量。</p>
<p>类型：Int64</p>
<h3 id="initint64-int64-int64"><a class="header" href="#initint64-int64-int64">init(Int64, Int64, Int64)</a></h3>
<pre><code class="language-cangjie">public init(
    capacity!: Int64 = 10 ** 4,
    queueCapacity!: Int64 = 10 ** 4,
    preheat!: Int64 = 0
)
</code></pre>
<p>功能：构造一个 <a href="http_package_structs.html#struct-servicepoolconfig">ServicePoolConfig</a> 实例。</p>
<p>参数：</p>
<ul>
<li>capacity!: Int64 - 协程池容量，默认值为 10000。</li>
<li>queueCapacity!: Int64 - 缓冲区等待任务的最大数量，默认值为 10000。</li>
<li>preheat!: Int64 - 服务启动时预先启动的协程数量，默认值为 0。</li>
</ul>
<p>异常：</p>
<ul>
<li>IllegalArgumentException - 当参数 capacity/queueCapacity/preheat 小于 0，或参数 preheat 大于 capacity。</li>
</ul>
<h2 id="struct-transportconfig"><a class="header" href="#struct-transportconfig">struct TransportConfig</a></h2>
<pre><code class="language-cangjie">public struct TransportConfig
</code></pre>
<p>功能：传输层配置类，服务器建立连接使用的传输层配置。</p>
<h3 id="prop-keepaliveconfig"><a class="header" href="#prop-keepaliveconfig">prop keepAliveConfig</a></h3>
<pre><code class="language-cangjie">public mut prop keepAliveConfig: SocketKeepAliveConfig
</code></pre>
<p>功能：设定和读取传输层连接的消息保活配置，默认配置空闲时间为 45s，发送探测报文的时间间隔为 5s，在连接被认为无效之前发送的探测报文数 5 次，实际时间粒度可能因操作系统而异。</p>
<p>类型：SocketKeepAliveConfig</p>
<h3 id="prop-readbuffersize"><a class="header" href="#prop-readbuffersize">prop readBufferSize</a></h3>
<pre><code class="language-cangjie">public mut prop readBufferSize: ?Int64
</code></pre>
<p>功能：设定和读取传输层连接的读缓冲区大小，默认值为 None ，若设置的值小于 0，将在服务器进行服务建立连接后抛出 IllegalArgumentException。</p>
<blockquote>
<p><strong>说明：</strong></p>
<p>使用默认值时，实际的缓冲区大小将由操作系统决定。</p>
</blockquote>
<p>类型：?Int64</p>
<h3 id="prop-readtimeout"><a class="header" href="#prop-readtimeout">prop readTimeout</a></h3>
<pre><code class="language-cangjie">public mut prop readTimeout: Duration
</code></pre>
<p>功能：设定和读取传输层连接的读超时时间，如果设置的时间小于 0 将置为 0，默认值为 Duration.Max。</p>
<p>类型：Duration</p>
<h3 id="prop-writebuffersize"><a class="header" href="#prop-writebuffersize">prop writeBufferSize</a></h3>
<pre><code class="language-cangjie">public mut prop writeBufferSize: ?Int64
</code></pre>
<p>功能：设定和读取传输层连接的写缓冲区大小，默认值为 None ，若设置的值小于 0，将在服务器进行服务建立连接后抛出 IllegalArgumentException。</p>
<blockquote>
<p><strong>说明：</strong></p>
<p>使用默认值时，实际的缓冲区大小将由操作系统决定。</p>
</blockquote>
<p>类型：?Int64</p>
<h3 id="prop-writetimeout"><a class="header" href="#prop-writetimeout">prop writeTimeout</a></h3>
<pre><code class="language-cangjie">public mut prop writeTimeout: Duration
</code></pre>
<p>功能：设定和读取传输层连接的写超时时间，如果设置的时间小于 0 将置为 0，默认值为 Duration.Max。</p>
<p>类型：Duration</p>

                    </main>

                    <nav class="nav-wrapper" aria-label="Page navigation">
                        <!-- Mobile navigation buttons -->
                            <a rel="prev" href="../../../net/http/http_package_api/http_package_enums.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
                                <i class="fa fa-angle-left"></i>
                            </a>

                            <a rel="next prefetch" href="../../../net/http/http_package_api/http_package_exceptions.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
                                <i class="fa fa-angle-right"></i>
                            </a>

                        <div style="clear: both"></div>
                    </nav>
                </div>
            </div>

            <nav class="nav-wide-wrapper" aria-label="Page navigation">
                    <a rel="prev" href="../../../net/http/http_package_api/http_package_enums.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
                        <i class="fa fa-angle-left"></i>
                    </a>

                    <a rel="next prefetch" href="../../../net/http/http_package_api/http_package_exceptions.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
                        <i class="fa fa-angle-right"></i>
                    </a>
            </nav>

        </div>




        <script>
            window.playground_copyable = true;
        </script>


        <script src="../../../elasticlunr.min.js"></script>
        <script src="../../../mark.min.js"></script>
        <script src="../../../searcher.js"></script>

        <script src="../../../clipboard.min.js"></script>
        <script src="../../../cangjie-highlight-export.js"></script><script src="../../../highlight.js"></script>
        <script src="../../../book.js"></script>

        <!-- Custom JS scripts -->
        
        <script src="../../../cangjie-highlight-export.js"></script><script src="../../../highlight.js"></script>
        <script src="../../../assets/elasticlunr.js"></script>
        <script src="../../../assets/fzf.umd.js"></script>
        <script src="../../../assets/sidebar.js"></script>


    </div>
    </body>
</html>
